﻿/*
 * @Author Wujiajun
 * @Data 2021/2/20
 * @Description 实体C#与Lua绑定
 * 
 */

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EntityLogicBehaviour : LuaBehaviour
{
    private Action m_OnEntityShow;
    private Action m_EntityOnHide;

    public override void Init(string _luaName)
    {
        base.Init(_luaName);
        m_ScriptEnv.Get("OnEntityHide", out m_EntityOnHide);
        m_ScriptEnv.Get("OnEntityShow", out m_OnEntityShow);
    }

    public void OnEntityHide()
    {
        m_EntityOnHide?.Invoke();
    }

    public void OnEntityShow()
    {
        m_OnEntityShow?.Invoke();
    }

    protected override void LuaClear()
    {
        base.LuaClear();
        m_EntityOnHide = null;
        m_OnEntityShow = null;
    }
}
